//1、导入路由
import VueRouter from 'vue-router';

//导入对应的组件
import HomeContainer from './components/tabbar/HomeContainer.vue';
import MemberContainer from './components/tabbar/MemberContainer.vue';
import ShopcarContainer from './components/tabbar/ShopcarContainer.vue';
import SearchContainer from './components/tabbar/SearchContainer.vue';

//新闻资讯列表
import NewsList from './components/news/NewsList.vue';
//新闻资讯详情
import NewsInfo from './components/news/NewsInfo.vue';
//图片分享
import PhotoList from './components/photos/PhotoList.vue';
//图片详情
import PhotoInfo from './components/photos/PhotoInfo.vue';
//商品列表
import GoodsList from './components/goods/GoodsList.vue';
//商品详情
import GoodsInfo from './components/goods/GoodsInfo.vue';
//图文详情
import GoodsDesc from './components/goods/GoodsDesc.vue';
//商品评论
import GoodsComment from './components/goods/GoodsComment.vue';

//3、创建路由对象
var router = new VueRouter({
    //配置路由规则
    routes: [ 
        {
            path: "/",
            component:HomeContainer
        },
        {
            path: '/home',
            component: HomeContainer
        }, {
            path: '/member',
            component: MemberContainer
        }, {
            path: '/shopcar',
            component: ShopcarContainer
        }, {
            path: '/search',
            component: SearchContainer
        },{
            path:'/home/newList',
            component: NewsList
        },{
            path:'/home/newsInfo/:id',
            component: NewsInfo
        },{
            path:'/home/photolist',
            component: PhotoList
        },{
            path:'/home/photoInfo/:id',
            component: PhotoInfo
        },{
            path:'/home/goodslist',
            component: GoodsList
        },{
            path:'/home/goodsInfo/:id',
            component: GoodsInfo,
            name:'goodsInfo' //该路由的名称
        },{
            path: '/home/goodsdesc/:id',
            component: GoodsDesc,
            name: 'GoodsDesc'
        },{
            path: '/home/goodscomment/:id',
            component: GoodsComment,
            name: 'GoodsComment'
        }
    ],
    //覆盖默认的路由高亮的类，默认的类叫做router-link-active
    linkActiveClass: 'mui-active' 
})
//把路由对象暴露出去
export default router;